package com.imboss.sell.utils;

import com.imboss.sell.VueObject.ResultVO;

/**
 * @ClassName ResultVOUtil
 * @Description 返回给前端最外层
 * @Author 钟鲁超
 * @Date 2019/3/2 0002 上午 11:16
 **/
public class ResultVOUtil {

    public static ResultVO success(Object object){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        resultVO.setData(object);
        return resultVO;
    }

    public static ResultVO success(){
        return success(null);
    }

    public static ResultVO error(Integer code,String msg){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }
}
